// 频道模块

import request from '@/utils/request.js'

// 获取频道列表
export const getChannels = function () {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

/**
 * 更新用户频道
 * @param {Object} channle id, esq
 */
export const addMyChannels = function (channle) {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [channle]
    }
  })
}

/**
 * 删除频道
 * @param {Number} id 频道id
 */
export const delChannels = id => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${id}`
  })
}
